self.onmessage = function (event) {
    // Worker 接收到的数据
    const data = event.data;

    console.log('Data received from main thread:', data);

    // 执行一些计算或处理
    const result = data * 2; // 简单相乘操作

    // 将结果发送回主线程
    self.postMessage(result);
};